import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s1 = in.nextLine();
        String s2 =in.nextLine();
        int n = s1.length();
        int x = s2.length();
        char[] ss1 = s1.toCharArray();
        char[] ss2 = s2.toCharArray();
        for(int i = 0; i < n; i++) {
            boolean flg = true;
            for (int j = 0; j < x; j++) {
                if(ss2[j] == ss1[i]) {
                    flg = false;
                }
            }
            if(flg) {
                System.out.print(ss1[i]);
            }
            flg = true;
            if(ss1[i] == ' ') {
                System.out.print(" ");
            }
        }
    }
}